<?php
header("Content-Type:text/html; charset=utf-8");
require("../../inc/common.inc.php");

$fid=intval($fid);
if ($fid==0){
	echo "-1";
	exit();
}
if ($val==""){
	echo "-1";
	exit();
}
$fileinfo=$db->getinfo("select fpath from mx_sucai_file  where fid='$fid' limit 1");
if (!is_array($fileinfo)){
	echo "-1";
	exit();
}
$edittime = mktime();
$val = rawurldecode ($val);
if($db->excu("update mx_sucai_file set fname='$val',edittime='$edittime',editid='".$_SESSION['mxadmin']['userid']."' where fid='$fid'")){
echo "1";
exit();
}else{
echo "-1";
exit();	
}
?>